|
|
|
|
|
|
|
Although this list is as current as I can make it, the best way to see if a control supports OLE drag and drop is to place it on a form and then check its property list. If OLEDragMode and OLEDropMode properties are listed, the control supports automatic or manual processing. |
|
|
|
|
|
|
|
|
For each drag-and-drop operation, there are events that are triggered on both sides of the operation. Each operation has a source control and a target control. If the control is contained in your application, you can add additional code to enhance the way OLE drag and drop works. |
|
|
|
|
|
|
|
|
The source control events are generated for both the automatic and manual types of processing. In contrast, the target controls events will only be triggered during a manual drop operation. All of the vents related to OLE drag and drop are listed in Table 15.2. |
|
|
|
|
| TABLE 15.2. OLE SOURCE AND TARGET EVENTS DESCRIBED. | | Type | Event | Description | | Source | OLEStarDrag | Occurs when the OLEDrag method is executed, or when an OLE drag/drop operation is initiated with the OLEDragMode property set to Automatic. | | OLESetData | Occurs for a source control when a target control executes the GetData method, but the data has not yet been loaded. | | OLEGiveFeedback | Occurs after the OLEDragOver event has been executed. | | OLECompleteDrag | Occurs when source data is dropped onto a target control. | | Target | OLEDragDrop | Occurs when source data is dropped onto a target control where a drop can occur. | | OLEDragOver | Occurs when one control is dragged over another. |
|
|
|
|
|
|
Depending on how you want the OLE drag and drop functionality to perform in your application, you add code only to the events you want the application to respond to. The simplest way to add the functionality is to use both the automatic drag and automatic drop features. In addition to controlling the drag-and-drop process, you can also change the mouse cursor to visually show the user that something is happening. |
|
|
|
|
|